using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;

using FreeFlow.Administration;

namespace FreeFlowAdministrator
{
	/// <summary>
	/// Summary description for ReportsControl.
	/// </summary>
	public class ReportsControl : System.Windows.Forms.UserControl
	{
    private ExtendedDataGrid reportsGrid;
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public ReportsControl()
		{
			// This call is required by the Windows.Forms Form Designer.
			InitializeComponent();
		}

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Component Designer generated code
		/// <summary> 
		/// Required method for Designer support - do not modify 
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
      this.reportsGrid = new ExtendedDataGrid();
      ((System.ComponentModel.ISupportInitialize)(this.reportsGrid)).BeginInit();
      this.SuspendLayout();
      // 
      // reportsGrid
      // 
      this.reportsGrid.DataMember = "";
      this.reportsGrid.Dock = System.Windows.Forms.DockStyle.Fill;
      this.reportsGrid.Location = new System.Drawing.Point(0, 0);
      this.reportsGrid.Name = "reportsGrid";
      this.reportsGrid.Size = new System.Drawing.Size(656, 456);
      this.reportsGrid.TabIndex = 0;
      // 
      // ReportsControl
      // 
      this.Controls.Add(this.reportsGrid);
      this.Name = "ReportsControl";
      this.Size = new System.Drawing.Size(656, 456);
      ((System.ComponentModel.ISupportInitialize)(this.reportsGrid)).EndInit();
      this.ResumeLayout(false);

    }
		#endregion
	
    public void LoadReports(ReportCollection reports)
    {
      reportsGrid.DataSource = reports;
      reportsGrid.ClearColumns();
      reportsGrid.AddColumn("Name");
      reportsGrid.AddColumn("Description");
      reportsGrid.AutosizeColumns();
    }
  }
}
